package com.dodoke.system.service.impl;

import com.dodoke.system.domain.SysWechatUserRoleDO;
import com.dodoke.system.mapper.SysWechatUserRoleMapper;
import com.dodoke.system.service.ISysWechatUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 微信小程序用户和角色关联Service业务层处理
 * 
 * @author ezreal_geng
 * @date 2020-08-27
 */
@Service
public class SysWechatUserRoleServiceImpl implements ISysWechatUserRoleService {
    @Autowired
    private SysWechatUserRoleMapper sysWechatUserRoleMapper;

    /**
     * 查询微信小程序用户和角色关联
     * 
     * @param wechatUserId 微信小程序用户和角色关联ID
     * @return 微信小程序用户和角色关联
     */
    @Override
    public SysWechatUserRoleDO selectSysWechatUserRoleById(Long wechatUserId) {
        return sysWechatUserRoleMapper.selectSysWechatUserRoleByWechatUserId(wechatUserId);
    }

    /**
     * 新增微信小程序用户和角色关联
     * 
     * @param sysWechatUserRoleDo 微信小程序用户和角色关联
     * @return 结果
     */
    @Override
    public int insertSysWechatUserRole(SysWechatUserRoleDO sysWechatUserRoleDo) {
        return sysWechatUserRoleMapper.insertSysWechatUserRole(sysWechatUserRoleDo);
    }
}
